<blockquote class="layui-elem-quote layui-quote-nm">
    SAAS系统版本列表，门店系统和总部系统
</blockquote>
<div>
    <button class="layui-btn  layui-btn-primary" onclick="app.open(0)"><i class="layui-icon"></i> 新增</button>

    <div style="display: inline-block;float: right;">
        <div class="layui-input-inline">
            <input type="tel" name="phone" lay-verify="phone" autocomplete="off" class="layui-input layui-input-small">
        </div>
        <button class="layui-btn  layui-btn-primary"><i class="layui-icon"></i> 查询</button>
    </div>
</div>
<hr>
<div>
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col>
            <col width="200">
            <col width="200">
            <col width="100">
        </colgroup>
        <thead>
        <tr>
            <th>系统类型</th>
            <th>模块</th>
            <th>版本</th>
            <th align="center">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($list as $item):?>
        <tr>
            <td style="background-color: #fff"
                rowspan="<?php echo count($item['items'])?>"><?php echo $item['name']?></td>
            <?php if(count($item['items'])>0):?>

            <td rowspan="<?php echo count($item['items'])?>"></td>
            <td><?php echo $item['items'][0]['name']?></td>
            <td align="center">
                <button class="layui-btn layui-btn-mini" onclick="app.open(<?php echo $item['items'][0]['id']?>)"><i class="layui-icon"></i> 编辑</button>
            </td>
            <?php else:?>

            <td></td>
            <td align="center"></td>
            <?php endif;?>
        </tr>
        <?php foreach($item['items'] as $i=>$citem):?>
        <?php if($i>0):?>
        <tr>


            <td><?php echo $citem['name']?></td>
            <td align="center">
                <button class="layui-btn layui-btn-mini" onclick="app.open(<?php echo $citem['id']?>)"><i class="layui-icon"></i> 编辑</button>
            </td>
        </tr>
        <?php endif;?>
        <?php endforeach;?>
        <?php endforeach;?>
        </tbody>
    </table>
</div>

<script>
    var app = {
        open: function (id) {
            layer.open({
                title: "编辑应用",
                type: 2,
                area: ["660px","420px"],
                content: "/os/edit?id="+id
            });
        }
    }
</script>